home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
bbsutils
/
sapphc.arj
/
ACCOUNT.DOC
< prev
next >
Wrap
Text File
|
1994-01-01
|
14KB
|
311 lines
╔═════════════════════════════════════════════════════════════════════════════╗
║ ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ ║
║ ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░ SAPPHIRE USAGE ACCOUNTING ░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░ ║
║ ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ ▒░▒░▒░▒░▒░▒░▒░▒░▒░▒░▒ ║
╚═════════════════════════════════════════════════════════════════════════════╝
╔═════════════════════════════════════════════════════════════════════════════╗
║ WARNING: Sapphire Accounting, when properly implemented, is a Zero-Main- ║
║ tenance feature. However, if you turn on accounting and do not also set up ║
║ the event to export and purge the information file, you can fill up your ║
║ disk. By default, Sapphire Accounting is turned OFF. ║
╚═════════════════════════════════════════════════════════════════════════════╝
WHAT IS SAPPHIRE ACCOUNTING?
════════════════════════════
Sapphire Accounting enables you to export usage records to another program so
you can bill users for their online time and downloads.
If you turn on Sapphire's accounting feature (SYSOP:CONFIG:SECURITY:ACCOUNTING)
each download and user session will generate an accounting record in a text
file named SAPPHIRE.ACC. You can set up a daily event (using Sapphire's EVENT
command) to extract the accounting data you need, then send the data to
another program for processing.
EXTRACTING THE DATA
═══════════════════
One convenient way to pre-process the data is with Pinnacle Software's
Parse-O-Matic program. This handy utility extracts and reformats data in a
text file according to rules you specify. The file ACCOUNT.POM is a
Parse-O-Matic control file created for Sapphire Accounting. It will read the
accounting file, strip out certain unwanted data, and create a "comma-
delimited" file appropriate for importing into a spreadsheet.
To try it out:
1) Obtain the Parse-O-Matic program (evaluation copy $6 by mail, or free
from our support BBS at 514-345-8654; registered copy: $25) and install
it in your Sapphire directory (or preferably, in a utility directory in
your DOS PATH).
2) Turn on accounting via SYSOP:CONFIG:SECURITY:ACCOUNTING.
3) Start up Sapphire.
4) Log on and off a few times to create some accounting data.
5) Shut down Sapphire.
6) Run Parse-O-Matic by entering this command at the DOS prompt:
POM ACCOUNT.POM SAPPHIRE.ACC TEST.TXT
This will process the accounting data file SAPPHIRE.ACC according to the
rules in the Parse-O-Matic control file ACCOUNT.POM and place the result
in the file TEST.TXT.
7) Enter the command SEE TEST.TXT to view the resulting file. This is a
comma-delimited file appropriate for importation into another program
such as a spreadsheet (e.g. Lotus 1-2-3, Excel, Quattro Pro) or database
(e.g. Paradox, DBase).
8) If you find that the information in TEST.TXT is not quite right for your
application (wrong format, missing or unwanted data), you can modify the
Parse-O-Matic control file (ACCOUNT.POM) using a text editor. Be sure
to make a backup copy first.
SETTING UP THE EVENT
════════════════════
Once you have created a Parse-O-Matic control file appropriate to your needs,
you will set up the batch file to be called by the daily event. The batch
file will look something like the following example (a copy of which is
available in the file ACCOUNT.BAT):
BATCH FILE LINE EXPLANATION
──────────────────────────────────────── ─────────────────────────────────────
@ECHO OFF Turn off batch file echo
POM ACCOUNT.POM SAPPHIRE.ACC ACCOUNT.TMP Run Parse-O-Matic
IF ERRORLEVEL 1 GOTO ERR Quit if some kind of data error
REM - - - - - - - - - - - - - - - - - - Comment line
REM Run import procedure here Comment line
REM - - - - - - - - - - - - - - - - - - Comment line
GOTO SAVE Jump ahead to SAVE label
:ERR Batch file label
COPY ACC.ERR+SAPPHIRE.ACC ACC.ERR Preserve the data
:SAVE Batch file label
IF EXIST SAPPHIRE.AC$ DEL SAPPHIRE.AC$ Delete backup copy of accounting data
RENAME SAPPHIRE.ACC SAPPHIRE.AC$ Make the data file a backup copy
The various steps of the event are described in more detail, below.
THE PARSING PROCEDURE
─────────────────────
The batch file runs Parse-O-Matic (the POM command) to extract data from the
file SAPPHIRE.ACC, according to the rules specified in the Parse-O-Matic
control file ACCOUNT.POM. The resulting data is placed in the file
ACCOUNT.TMP.
THE IMPORT PROCEDURE
────────────────────
The import procedure (indicated by comments in the sample batch file) is the
step that actually reads the extracted data (which resides in the file
ACCOUNT.TMP) into your spreadsheet or database. You will have to write a
spreadsheet or database script or macro to perform the import. Alternatively,
you can use a DOS keyboard stacker utility (such as "STACKKEY"), or a keyboard
macro processor (such as Superkey or Newkey) to play back the keystrokes
required to perform the import.
THE ERROR TRAPPING PROCEDURE
────────────────────────────
After Parse-O-Matic is run, the batch file checks the DOS ERRORLEVEL. In the
unlikely event that it is set to 1 or higher, it means that something went
wrong in the data extraction step, so the batch file jumps to the :ERR label
-- skipping the import procedure.
The error handling procedure executes this command:
COPY ACC.ERR+SAPPHIRE.ACC ACC.ERR
This command will place the raw accounting data at the end of the file
ACC.ERR. Thus, even if you don't notice the error for several days, you won't
lose any data -- it will be preserved in the file ACC.ERR.
AFTER THE EVENT
───────────────
There is no need to add code to the batch file to start up Sapphire. The
event-processing feature of Sapphire actually runs a copy of the batch file
(rather than the batch file itself) and adds the necessary commands to restart
the BBS.
After the batch file is run, the file SAPPHIRE.ACC is gone -- it is renamed to
SAPPHIRE.AC$ by the batch file -- but it will be recreated automatically by
Sapphire.
ACCOUNTING RECORD TYPES
═══════════════════════
Several kinds of records appear in the accounting log:
TYPE DESCRIPTION
──── ──────────────────────
A Arrival record
D Download record
S Session summary record
These are described in more detail, below.
THE ARRIVAL RECORD
══════════════════
A "Type A" record contains the letter "A" in column one. It looks like this:
╔════════╤═════════════════════════════════════════════════════════════════════╗
║ COLUMN │ ∙∙∙∙■∙∙∙10∙∙∙∙■∙∙∙20∙∙∙∙■∙∙∙30∙∙∙∙■∙∙∙40∙∙∙ ║
║ │ ════════════════════ ════════════════════ ║
║ DATA │ S AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA ║
║ │ ════════════════════ ════════════════════ ║
║ │ REAL NAME USER NAME ║
╚════════╧═════════════════════════════════════════════════════════════════════╝
The fields are as follows:
START FIELD
COLUMN LENGTH DESCRIPTION
────── ────── ───────────
1 1 The letter "A" -- this identifies a "Type A" record
3 20 The user's real name (as entered during sign-up)
24 20 The user's sign-on name (sometimes called "Handle" or "Alias")
THE DOWNLOAD RECORD
═══════════════════
A "Type D" record contains the letter "D" in column one. It is written to the
accounting file whenever the user successfully completes a download. It looks
like this:
╔════════╤═════════════════════════════════════════════════════════════════════╗
║ COLUMN │ ∙∙∙∙■∙∙∙10∙∙∙∙■∙∙∙20∙∙∙∙■∙∙∙30∙ ║
║ │ ════════ ═══ L F P ══════════ ║
║ DATA │ D AAAAAAAA AAA E A R NNNNNNNNNN ║
║ │ ════════ ═══ V O ══════════ ║
║ │ ROOTNAME EXT FILE SIZE ║
╚════════╧═════════════════════════════════════════════════════════════════════╝
The fields identify a file that was downloaded, as follows:
START FIELD
COLUMN LENGTH DESCRIPTION
────── ────── ───────────
1 1 The letter "D" -- this identifies a "Type D" record
3 8 Root name of the file (e.g. XYZ.DAT's root is XYZ)
12 3 Extension of the file (e.g. XYZ.DAT's extension is DAT)
16 1 Minimum level required to download this file
18 1 File area in which the file was placed
20 1 Protocol used to download the file
22 10 Size of the file in bytes (not kilobytes, as in other records)
THE SESSION SUMMARY RECORD
══════════════════════════
A "Type S" record contains the letter "S" in column one. Using the default
format, the record looks like this:
╔════════╤═════════════════════════════════════════════════════════════════════╗
║ COLUMN │ ∙∙∙∙■∙∙∙10∙∙∙∙■∙∙∙20∙∙∙∙■∙∙∙30∙∙∙∙■∙∙∙40∙∙∙∙■∙∙∙50∙∙∙∙■∙∙∙60∙∙∙∙■ ║
║ │ ════════════════════ ════════════════════ L ═════ ══════════ ║
║ DATA │ S AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA E NNNNN DDDDD MMMM ║
║ │ ════════════════════ ════════════════════ V ═════ ══════════ ║
║ │ REAL NAME USER NAME CALLS LAST CALL ║
╟────────┼─────────────────────────────────────────────────────────────────────╢
║ COLUMN │ ∙∙∙70∙∙∙∙■∙∙∙80∙∙∙∙■∙∙∙90∙∙∙∙■∙∙100∙∙∙∙■∙∙110∙∙∙∙■∙∙120∙∙∙∙■∙∙130 ║
║ │ ══════════════════════════════ ══════════════════════════════ ║
║ DATA │ YY/MM/DD HH:MM:SS DDDDD MMMM W YY/MM/DD HH:MM:SS DDDDD MMMM W ║
║ │ ══════════════════════════════ ══════════════════════════════ ║
║ │ START OF CALL END OF CALL ║
╟────────┼─────────────────────────────────────────────────────────────────────╢
║ COLUMN │ ∙∙∙∙■∙∙140∙∙∙∙■∙∙150∙∙∙∙■∙∙160∙∙∙∙■∙∙170∙∙∙∙■∙∙180∙∙∙∙■∙∙190∙∙∙∙■ ║
║ │ ═════ ═════ ═════════ ═════════ ═════ ═════ ═════════ ═════════ ║
║ DATA │ NNNNN NNNNN NNNNNNNNN NNNNNNNNN NNNNN NNNNN NNNNNNNNN NNNNNNNNN ║
║ │ ═════ ═════ ═════════ ═════════ ═════ ═════ ═════════ ═════════ ║
║ │ SESSN TOTAL SESSION TOTAL SESSN TOTAL SESSION TOTAL ║
║ │ DNLDS DNLDS DOWNLOADK DOWNLOADK UPLDS UPLDS UPLOADK UPLOADK ║
╟────────┼─────────────────────────────────────────────────────────────────────╢
║ COLUMN │ ∙∙200∙∙∙∙■∙∙210∙∙∙∙■∙∙220∙∙∙∙■∙∙230 ║
║ │ ═════ ═════ ════════════════ ┌────────────────────────┐ ║
║ DATA │ NNNNN NNNNN **************** │ Blank spaces are │ ║
║ │ ═════ ═════ ════════════════ │ reserved for expansion │ ║
║ │ SESSN TOTAL READ FLAGS └────────────────────────┘ ║
║ │ POSTS POSTS ║
╚════════╧═════════════════════════════════════════════════════════════════════╝
Using the default format, the fields are as follows:
START FIELD
COLUMN LENGTH DESCRIPTION
────── ────── ───────────
1 1 The letter "S" -- this identifies a "Type S" record
3 20 The user's real name (as entered during sign-up)
24 20 The user's sign-on name (sometimes called "Handle" or "Alias")
45 1 User level (0 to 8)
47 5 Total number of visits by this user (*)
53 5 Day # of previous call from this user
59 4 Minute-of-day of previous call from this user
66 8 Start of call date (Year/Month/Date format)
75 8 Start of call time (Hour:Minute:Second format)
84 5 Start of call day #
90 4 Start of call minute-of-day
95 1 Start of call day-of-week (0=Sunday, 1=Monday ... 6=Saturday)
99 8 End of call date (Year/Month/Date format)
108 8 End of call time (Hour:Minute:Second format)
117 5 End of call day #
123 4 End of call minute-of-day
128 1 End of call day-of-week (0=Sunday, 1=Monday ... 6=Saturday)
131 5 Number of downloads (this call)
139 5 Number of downloads (all calls)
143 9 Kilobytes downloaded (this call)
153 9 Kilobytes downloaded (all calls)
165 5 Number of uploads (this call)
171 5 Number of uploads (all calls)
177 9 Kilobytes uploaded (this call)
187 9 Kilobytes uploaded (all calls)
201 5 Number of SENDs (this call)
207 5 Number of SENDs (all calls)
215 1 Read flag: Checked OBSERVE ("*" for Yes, "-" for No)
216 15 Read flags: 15 message bases ("*" if read, "-" if not)
(*) For reasons relating to its internal data format, Sapphire stops
incrementing this value when it reaches 65000 visits.
The read flags for message bases are set (i.e. show "*") only if the user
actually saw some new messages. The "*" will not be set if he entered a READ
command for a particular base and saw nothing there, or if he used SET to
back up to earlier messages.
Except for "Start of Call" data, all data is obtained at the END of the call.
So if you alter a user's level during the call (via function key), the
modified level will be recorded.
The record format shown above will change if you set a different date format.
The default date format is YY/MM/DD (Year, Month, Day). However, you can set
a different date format if you wish, using the CONFIG program:
- Select SYSOP:CONFIG:SECURITY:ACCOUNTING; move your cursor to Date Format
- Press F1 for an explanation of the format string